#ifndef PARTICLE_H
#define PARTICLE_H

class Particle {
private:
	int gridIndex[3];
	int particleIndex;

	float position[3];
	float velocity[3];
	float mass;
	float force[3];
	static int indexCount; //used to populate global particle array
	void calculateCollisionForces();
	void calculateCollisionForcesWithGrid();
	void calculateBoundaryForces();
public:
	Particle() { }
	Particle(float* position, float mass);
	float* getForce();
	float* getPosition();
	float* getVelocity();
	void populateArray();
	void updateVelocity(float* bodyPosition, float* bodyVelocity, float* bodyAngularVelocity);
	void applyRotation(float* rotationMatrix, float* originalRelativePos, float* bodyPosition);
	float* calculateForces();
	void reset(float* oldBodyPos, float* newBodyPos);

	void updateGridIndex();
	int* getGridIndex();

	void updateOpenCLArray(int particleIndex);
};

#endif
